package com.itunion.ddd.common.base.constant;

import lombok.Data;

import java.io.Serializable;

@Data
public class BaseResponse<T> implements Serializable {

    private static final long serialVersionUID = 5851419527617790088L;
    String code;
    String message;
    T result;

    public BaseResponse() {
    }

    public BaseResponse(String code, String message) {
        this.code = code;
        this.message = message;
    }
    public BaseResponse(String code, String message, T result) {
        this.code = code;
        this.message = message;
        this.result = result;
    }

    public BaseResponse(T data) {
        this.code = BaseCode.SUCCESS.getCode();
        this.message = BaseCode.SUCCESS.getDesc();
        this.result = data;
    }

}